from utils.client import APIClient
from utils.yaml_config import get_yaml

data = get_yaml('monitor.yaml')

class Api_Monitor:


    def __init__(self,client:APIClient):
        self.client = client

    def monitor_front(self):
        monitor_data = data['front']['request']
        return self.client.request(monitor_data['method'],monitor_data['path'])
    
    def monitor_info(self):
        monitor_data = data['info']['request']
        return self.client.request(monitor_data['method'],monitor_data['path'])
    
    def monitor_get(self):
        monitor_data = data['get']['request']
        return self.client.request(monitor_data['method'],monitor_data['path'])
    
    def monitor_top(self):
        monitor_data = data['top']['request']
        return self.client.request(monitor_data['method'],monitor_data['path'])
    
    def monitor_inner(self,index=0):
        monitor_data = data['inner']['request']
        return self.client.request(monitor_data['method'],monitor_data['path'],json=monitor_data['json'][index])
    
    def monitor_device(self,index=0):
        monitor_data = data['device']['request']
        return self.client.request(monitor_data['method'],monitor_data['path'],json=monitor_data['json'][index])
    
    def monitor_list(self):
        monitor_data = data['list']['request']
        return self.client.request(monitor_data['method'],monitor_data['path'],json=monitor_data['json'])
    
    def monitor_curve(self):
        monitor_data = data['curve']['request']
        return self.client.request(monitor_data['method'],monitor_data['path'],json=monitor_data['json'])
    

